package com.example.arithmeticleetcode.leetcode.July;


import java.util.Arrays;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-07-07 18:22
 **/
public class Demo04 {

    public static void main(String[] args) {

    }

    public static int getLastMoment(int n, int[] left, int[] right) {
        Arrays.sort(left);
        Arrays.sort(right);
        return Math.max(left.length > 0 ? left[left.length - 1] : 0, right.length > 0 ? n - right[0] : 0);
    }

}
